#include <bits/stdc++.h>
using namespace std;

typedef unsigned int u32;
u32 sd=time(0);
inline u32 rd() {
	sd ^= sd << 17, sd ^= sd >> 5, sd ^= sd << 23;
	return sd;
}

void gen(int lim, int n_ini, int n_pus, int n_pop, int n_ins, int n_fnd, int err = 0) {
	cout << n_ini << endl;
	for(int i = 0; i < n_ini; ++i) cout << rd() % lim << ' ';
	cout << n_pus << endl;
	for(int i = 0; i < n_pus; ++i) cout << rd() % lim << ' ';
	if(err == 1) n_pop = n_ini + 1;
	cout << n_pop << endl;
	if(err == 2) {
		cout << 1 << endl;
		for(int i = 0; i < n_ins; ++i) cout << rd() % lim << ' ' << n_ini + n_pus + 1 << endl;
	}
	else {
		cout << n_ins << endl;
		for(int i = 0; i < n_ins; ++i) cout << rd() % lim << ' ' << rd() % (n_ini + n_pus + i + 1) << endl;
	}
	cout << n_fnd << endl;
	for(int i = 0; i < n_fnd; ++i) cout << rd() % lim << ' ';
	cout << endl;
}

int main(){
	freopen("test1.in", "w", stdout);
	gen(10, 10, 5, 5, 5, 5);
	fclose(stdout);
	
	freopen("test2.in", "w", stdout);
	gen(10, 10, 5, 5, 5, 5, 1);
	fclose(stdout);
	
	freopen("test3.in", "w", stdout);
	gen(10, 10, 5, 5, 5, 5, 2);
	fclose(stdout);
}